<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include_once("../config.inc.php");

$_LangPath = 'sixnumber31';	//語言檔參數，務必放在最前面
$intLottoID = empty($_data["LottoID"])?1:(int)$_data["LottoID"];
$intBT = (int)$_data["Bet_Type"];
if(empty($intBT))$intBT = 31;

include_once(__Member_Path."/logincheck_nodb.php");
include_once(__Language_Path."/selectlanguage_member.php");
include_once(__Modules_Path."/ChangeTime.lib.php");
include_once(__Common_Path."/Lotto.inc.php");
include_once(__Common_Path."/SysParam.inc.php");
include_once(__Common_Path."/todaygame/Gamble". $intLottoID.".inc.php");
include_once(__Common_Path."/gambletype/GambleType". $_SESSION["Member_Info"] -> GambleType."_".$intLottoID.".inc.php");

//取得 TodayGame 資料
include_once(__Common_Path."/todaygame/TodayGame".$intLottoID."_".$intBT.".inc.php");

$isStart = false;
if(sizeof($_arrGamble))list($intGID, $arrGData) = each($_arrGamble);

//判斷是否有 Game 時間是否過期
$GameEndDateTime	= $arrGData["GameDate"] .' '. $arrGData["EndGameTime"];
$NowDateTime		= date("Y-m-d") .' '. date("H:i:s");

$strTemplateFile = __Membertemplate_Path."/sixnumber31.html";
if ($NowDateTime <= $GameEndDateTime) {
	$isStart = true;
	$arrTodayGame = $_arrTodayGame[$intGID][$intBT];
}

$fp = @file($strTemplateFile);
$fp = implode("", $fp);
$fp = setHTMLCharset($fp);
$fp = str_replace("{ShowSid}", $_data["sid"], $fp);
$fp = str_replace("{ShowLottoID}", $intLottoID, $fp);
$fp = str_replace("{ShowGambleID}", $intGID, $fp);
$fp = str_replace("{ShowSerialNo}", $arrGData["SerialNo"], $fp);
$fp = str_replace("{ShowGameDate}", $arrGData["GameDate"], $fp);
$fp = str_replace("{ShowGameTime}", $arrGData["GameTime"], $fp);
$fp = str_replace("{MaxOfJoinNumber}", $_KSysParam["MaxOfJoinNumber"], $fp);
$fp = str_replace("{Mantissa}", $_strSame_String["Mantissa"], $fp);
$fp = str_replace("{BT".$intBT."CK}", "checked", $fp);
$fp = str_replace("{BetType}", $intBT, $fp);

$intApointNum = 0;
$strCon = "";
if($isStart){
	foreach($arrTodayGame as $intNum => $Rows){
		$strCon .= "Game[".$Rows["Number"]."]={Number:'".$Rows["Number"]."',OddsID:'".$Rows["OddsID"]."',Odds:'".($Rows["Odds"]+$_arrGambleType[$Rows["Bet_Type"]][$intApointNum])."',isStopBet:'".$Rows["isStopBet"]."'};\n";
	}
}
$fp = str_replace("//GameList", $strCon, $fp);

while(list($k, $v) = each($_strSixNumber31)){
	$fp = str_replace("{".$k."}", $v, $fp);
}

//輸出
WebOutputHTML($fp, 1);
?>